package com.group9.handinhand.service;

import java.util.ArrayList;
import java.util.List;

import org.springframework.security.core.userdetails.UserDetailsService;

import com.group9.handinhand.dao.model.User;
import com.group9.handinhand.exception.HandInHandException;
import com.group9.handinhand.service.so.FriendshipRequestSO;
import com.group9.handinhand.service.so.FriendshipSO;
import com.group9.handinhand.service.so.PasswordResetLinkSO;
import com.group9.handinhand.service.so.UserSO;
/**
 * 
 * Interface that defines user details service.
 *
 */
public interface UserService extends UserDetailsService {
	
	public List<User> getAllUsers();

	public UserSO registerUser(UserSO user);
	
	public UserSO updateUser(UserSO user);

	public UserSO getUserByEmail(String email);

	public UserSO getUserByUsername(String username);
	
	public User getUserByEmailAndPassword(String email, String password) throws HandInHandException ;
	
	public User getUserByUsernameAndPassword(String email, String password) throws HandInHandException ;

	public UserSO getUserById(Long userId);
	
	public FriendshipSO getFriendship(Long firstUserId, Long secondUserId);

	public FriendshipRequestSO saveFriendshipRequest(Long senderId, Long receiverId);

	public ArrayList<FriendshipRequestSO> getFriendshipRequests(Long userId);

	public FriendshipRequestSO getFriendshipRequest(Long userId1, Long userId2);

	public FriendshipSO saveFriendship(Long firstUserId, Long secondUserId);

	public void deleteFriendshipRequest(Long senderId, Long receiverId);

	public void deleteFriendship(Long firstUserId, Long secondUserId);
	
	public ArrayList<FriendshipSO> getFriendships(Long userId);

	public PasswordResetLinkSO savePasswordResetLink(UserSO user, String nextRandomPasswordResetLink);

	public PasswordResetLinkSO getPasswordResetLinkByLink(String link);

	public void deletePasswordResetLinksOfUser(UserSO user);

	public UserSO deletePicture(UserSO user);
	
}